import Vue from 'vue'
import Vuex from 'vuex'
import * as getters from './getters'
import * as actions from './actions'
import mutations from './mutations'

Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production'
const state = {
  jwt: '',
  name: '',
  currentMainMenu: '',
  menus: [],
  websocket: {
    '$socket': null,
    isConnected: false,
    message: [],
    reconnectError: false
  },
  commonsState: [],
  mapMessages: [],
  queryMap: [104.0609171, 30.5870272],
  statusOptions: {
    commons: [{
      value: 1,
      text: '正常'
    }, {
      value: 0,
      text: '关闭'
    }]
  },
  menuLevelOptions: {
    commons: [{
      value: 1,
      text: '一级菜单'
    }, {
      value: 2,
      text: '二级菜单'
    }, {
      value: 3,
      text: '三级菜单'
    }]
  }
}
export default new Vuex.Store({
  state,
  getters,
  actions,
  mutations,
  strict: debug
})
